<div>

  <select ng-model="controller.version"
          ng-disabled="!controller.versions.length"
          class="form-control version-dropdown">

    <option ng-if="controller.versions.length"
            ng-selected="controller.isSelected('HEAD')"
            value="HEAD">
      HEAD
    </option>

    <!-- We cannot use ng-options here, since it does not set the selected attribute. -->
    <option ng-repeat="v in controller.versions"
            ng-selected="controller.isSelected(v.value)"
            value="{$ v.value $}">
      {$ v.value | grrTimestamp $}
    </option>

    <option ng-if="!controller.versions.length"
            ng-selected="true"
            value="">
      No versions available.
    </option>

  </select>

  <!-- Indicate that we are not showing the latest item. -->
  <div class="newer-version-hint" ng-if="!controller.isLatestSelected()">
    Newer Version available.
  </div>

</div>
